package org.apache.mf.config;

import org.apache.mf.aop.LogAspect;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import javax.annotation.Resource;

/**
 * @Author: kyrie  @date: 2023/1/29 10:27
 * @Description:
 * @Package: org.apache.mf.config
 * @Email: wuxiang@roowoo.cn
 */
@Configuration
@EnableConfigurationProperties(LogAspectProperties.class)
@ConditionalOnProperty(prefix = "global.aop.log", value = "enabled", matchIfMissing = true)
public class LogAspectAutoConfig {

    @Bean
    @ConditionalOnMissingBean
    public LogAspect logAspect() {
        return new LogAspect();
    }


}
